<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;

use think\Validate;

class AdminAdvantageValidate extends Validate
{
    protected $rule =   [
        'title'             => 'require|max:40',
        'title_en'          => 'require|max:40',
        'introduce'         => 'require|max:500',
        'introduce_en'      => 'require|max:500',
    ];

    protected $message  =   [
        'title.require'              => '标题不能为空',
        'title.max'                  => '标题不能超多40个字符',
        'title_en.require'           => '标题（英文）不能为空',
        'title_en.max'               => '标题（英文）不能超多40个字符',
        'introduce.require'          => '简介不能为空',
        'introduce.max'              => '简介不能超多500个字符',
        'introduce_en.require'       => '简介（英文）不能为空',
        'introduce_en.max'           => '简介（英文）不能超多500个字符',
    ];

    protected $scene = [
        'add'   =>   ['title','title_en','introduce','introduce_en'],
        'edit'   =>   ['title','title_en','introduce','introduce_en'],
    ];
}